#pragma once
#include <functional>
#include <nice2d/predef.h>
#include <nice2d/messagelistener.h>

class ProxyMessageListener : public MessageListener
{
public:
    ProxyMessageListener() = delete;
    ProxyMessageListener(std::function<bool(MessagePointer)> inputFunction):
        function(inputFunction)
    {
    }
public:
    bool onListener(MessagePointer message)
    {
        if(function)
            return function(message);
        return false;
    }
private:
    std::function<bool(MessagePointer)> function;
};
